export const formatTime = (date?: Date) => {
    let dt = date == undefined ? new Date() : date;
    let y = dt.getFullYear(),
        m = (dt.getMonth() + 1 + "").padStart(2, "0"),
        d = (dt.getDate() + "").padStart(2, "0"),
        hh = (dt.getHours() + "").padStart(2, "0"),
        mm = (dt.getMinutes() + "").padStart(2, "0"),
        ss = (dt.getSeconds() + "").padStart(2, "0");
    return `${y}-${m}$-${d}_${hh}:${mm}:${ss}`
}